var oUl = document.querySelectorAll('.dropdown-menu')[0];
var oUl1 = document.querySelectorAll('.dropdown-menu')[1];
oUl.addEventListener('click',xuanze);
oUl1.addEventListener('click',xuanze1);
var oBut =document.querySelector('.blu');
var oBut1 =document.querySelector('.blu1');
var oInt =document.querySelectorAll('.lang');
var nzt = document.querySelectorAll('.ztai');
var oxiala ;
var oxiala1 ;

//按钮下拉；
var dian = document.querySelectorAll('.nav ul li');
for(var i=0;i<dian.length;i++){
    dian[i].onclick = function(){
        console.log(123)
      console.log(this.lastElementChild.style.height)  ;
      if(this.lastElementChild.style.height=='0px'){
        this.lastElementChild.style.height ='auto';
      }else{
        this.lastElementChild.style.height ='0px';

      }
    }
}
function xuanze(){
    oxiala = event.target.innerText
    oBut.innerHTML  = event.target.innerText;
}
function xuanze1(){
    oxiala1 = event.target.innerText
    oBut1.innerHTML  = event.target.innerText;
    
}
var oFrom = document.querySelector('form');
oFrom.onsubmit = function(){
   
    var oDate = document.querySelector('#date');
    for(var i=0;i<oInt.length;i++){
      if(pd(oInt[i])){
       console.log('有数据为空');
        localStorage.clear();
        event.preventDefault(); 
        break;
      }else{
      
        localStorage.setItem('xiu'+i,oInt[i].value);
      }
    }
    var stl=  pd2();
    localStorage.setItem('zt1',stl);
    localStorage.setItem('xl',oxiala);
    localStorage.setItem('xl1',oxiala1);
    localStorage.setItem('date1',oDate.value)
   
} 
//判断装备状态
function pd2(){
    var str =null;
    for(var i=0;i<nzt.length;i++){
        if(nzt[i].checked){
           str= nzt[i].value;
           
        }
    }
    return str;
}
//判断input框是否为空
function pd(inp){
   
    if(inp.value==''){
        return true;
    }
    return false;
}
//获取下拉框的数据
